/*
 * Copyright (c) 2021 Futurewei Technologies, Inc.
 *
 * clang2mpl is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan
 * PSL v2. You may obtain a copy of Mulan PSL v2 at:
 *
 *     http://license.coscl.org.cn/MulanPSL2
 *
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
 * NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. See the
 * Mulan PSL v2 for more details.
 */
// RUN: %clang2mpl --ascii --verify %s -- -Wno-unused-value --target=aarch64-linux-elf
// RUN: cat %m | %FileCheck %s

struct A {
  int x;
  int y;
  int z;
};

struct B {
  int x;
  struct A a;
  int y;
  int z;
};

struct D {
  int x;
  int y;
};

struct E {
  int a;
  struct D d1;
  struct D d2;
  int b;
};

struct F {
  int x;
  struct D y[2];
  int z;
};

struct G {
  int x;
  struct F y;
};

// CHECK: LOC 2 [[# @LINE + 2 ]]{{$}}
// CHECK-NEXT: var $gI1 u32 = 42
unsigned int gI1 = 42;
// CHECK: LOC 2 [[# @LINE + 2 ]]{{$}}
// CHECK-NEXT: var $gF1 f32 = 4.30000019f
float gF1 = 4.3f;
// CHECK: LOC 2 [[# @LINE + 2 ]]{{$}}
// CHECK-NEXT: var $gD1 f64 = 3.1400000000000001
double gD1 = 3.14;
// CHECK: LOC 2 [[# @LINE + 2 ]]{{$}}
// CHECK-NEXT: var $gLD1 f64 = 4.4400000000000004
long double gLD1 = 4.44L;
// CHECK: LOC 2 [[# @LINE + 2 ]]{{$}}
// CHECK-NEXT: var $gsA1 <$A> = [1= 0, 2= 1, 3= 2]
struct A gsA1 = {0, 1, 2};
// CHECK: LOC 2 [[# @LINE + 2 ]]{{$}}
// CHECK-NEXT: var $gsA2 <$A> = [1= 42, 2= 0, 3= 0]
struct A gsA2 = {42};
// CHECK: LOC 2 [[# @LINE + 2 ]]{{$}}
// CHECK-NEXT: var $gA1 <[5] i32> = [9, 8, 7, 6, 5]
int gA1[] = {9, 8, 7, 6, 5};
// CHECK: LOC 2 [[# @LINE + 2 ]]{{$}}
// CHECK-NEXT: var $gA2 <[4] i16> = [2, 0, 0, 0]
short gA2[4] = {2};
// CHECK: LOC 2 [[# @LINE + 2 ]]{{$}}
// CHECK-NEXT{LITERAL}: var $gA3 <[3][2] i32> = [[1, 2], [3, 4], [5, 6]]
int gA3[3][2] = {{1, 2}, {3, 4}, {5, 6}};
// CHECK: LOC 2 [[# @LINE + 2 ]]{{$}}
// CHECK-NEXT{LITERAL}: var $gA4 <[3][2] i32> = [[1, 2], [0, 0], [0, 0]]
int gA4[3][2] = {{1, 2}};
// CHECK: LOC 2 [[# @LINE + 2 ]]{{$}}
// CHECK-NEXT{LITERAL}: var $gA5 <[3][2] i32> = [[1, 0], [0, 0], [0, 0]]
int gA5[3][2] = {{1}};
// CHECK: LOC 2 [[# @LINE + 2 ]]{{$}}
// CHECK-NEXT{LITERAL}: var $gA6 <[3][2] i32> = [[1, 2], [0, 0], [0, 0]]
int gA6[3][2] = {1, 2};
// CHECK: LOC 2 [[# @LINE + 2 ]]{{$}}
// CHECK-NEXT{LITERAL}: var $gA7 <[3][2] i32> = [[2, 0], [0, 0], [0, 0]]
int gA7[3][2] = {2};
// CHECK: LOC 2 [[# @LINE + 2 ]]{{$}}
// CHECK-NEXT: var $gStr1 <[6] u8> = [104, 101, 108, 108, 111, 0]
char gStr1[] = "hello";
// CHECK: LOC 2 [[# @LINE + 2 ]]{{$}}
// CHECK-NEXT: var $gStr2 <* u8> = conststr a64 "world"
char *gStr2 = "world";
// CHECK: LOC 2 [[# @LINE + 2 ]]{{$}}
// CHECK-NEXT: var $gB1 <$B> = [1= 9, 2= [1= 8, 2= 7, 3= 6], 3= 5, 4= 4]
struct B gB1 = {9, {8, 7, 6}, 5, 4};
// CHECK: LOC 2 [[# @LINE + 2 ]]{{$}}
// CHECK-NEXT: var $gB2 <$B> = [1= 42, 2= [1= 0, 2= 0, 3= 0], 3= 0, 4= 0]
struct B gB2 = {42};
// CHECK: LOC 2 [[# @LINE + 2 ]]{{$}}
// CHECK-NEXT: var $gE <$E> = [1= 1, 2= [1= 2, 2= 3], 3= [1= 4, 2= 5], 4= 6]
struct E gE = {1, {2, 3}, {4, 5}, 6};
// CHECK: LOC 2 [[# @LINE + 2 ]]{{$}}
// CHECK-NEXT{LITERAL}: var $gsF1 <$F> = [1= 42, 2= [[1= 9, 2= 8], [1= 7, 2= 6]], 3= 5]
struct F gsF1 = {42, {{9, 8}, {7, 6}}, 5};
// CHECK: LOC 2 [[# @LINE + 2 ]]{{$}}
// CHECK-NEXT{LITERAL}: var $gsF2 <$F> = [1= 0, 2= [[1= 0, 2= 0], [1= 0, 2= 0]], 3= 0]
struct F gsF2 = {0};
// CHECK: LOC 2 [[# @LINE + 2 ]]{{$}}
// CHECK-NEXT{LITERAL}: var $gsG1 <$G> = [1= 5, 2= [1= 42, 2= [[1= 9, 2= 8], [1= 7, 2= 6]], 3= 5]]
struct G gsG1 = {5, {42, {{9, 8}, {7, 6}}, 5}};
// CHECK: LOC 2 [[# @LINE + 2 ]]{{$}}
// CHECK-NEXT{LITERAL}: var $gsG2 <$G> = [1= 0, 2= [1= 0, 2= [[1= 0, 2= 0], [1= 0, 2= 0]], 3= 0]]
struct G gsG2 = {0};
// CHECK: LOC 2 [[# @LINE + 2 ]]{{$}}
// CHECK-NEXT{LITERAL}: var $gaF1 <[2] <$F>> = [[1= 42, 2= [[1= 9, 2= 8], [1= 7, 2= 6]], 3= 5], [1= 0, 2= [[1= 0, 2= 0], [1= 0, 2= 0]], 3= 0]]
struct F gaF1[2] = {{42, {{9, 8}, {7, 6}}, 5}, {0}};
// CHECK: LOC 2 [[# @LINE + 2 ]]{{$}}
// CHECK-NEXT{LITERAL}: var $gaF2 <[3] <$F>> = [[1= 1, 2= [[1= 0, 2= 0], [1= 0, 2= 0]], 3= 0], [1= 0, 2= [[1= 0, 2= 0], [1= 0, 2= 0]], 3= 0], [1= 0, 2= [[1= 0, 2= 0], [1= 0, 2= 0]], 3= 0]]
struct F gaF2[3] = {{1}};

int apArr1[8];
// CHECK: LOC 2 [[# @LINE + 2 ]]{{$}}
// CHECK-NEXT: var $ap1 <* i32> = addrof ptr $apArr1 (4)
int *ap1 = &apArr1[1];

short apArr2[3][4];
// CHECK: LOC 2 [[# @LINE + 2 ]]{{$}}
// CHECK-NEXT: var $ap2 <* i16> = addrof ptr $apArr2 (12)
short *ap2 = &apArr2[1][2];
// CHECK: LOC 2 [[# @LINE + 2 ]]{{$}}
// CHECK-NEXT: var $ap3 <* i16> = addrof ptr $apArr2 (16)
short *ap3 = (short *)&apArr2[2];

struct S {
  int x;
  int y;
};

struct S apArr3[4][5];
// CHECK: LOC 2 [[# @LINE + 2 ]]{{$}}
// CHECK-NEXT: var $ap4 <* i32> = addrof ptr $apArr3 (92)
int *ap4 = &apArr3[2][1].y;

// CHECK{LITERAL}: var $aa <[4] <[4] i32>> = [[0, 0, 0, 0], [0, 0, 0, 0], [2, 0, 0, 0], [0, 0, 0, 0]]
int aa[4][4] = { {0}, {}, {2}};

// CHECK: var $ab <$AB> = [1= 4, 2= [0, 0, 0, 0], 3= 5]
struct AB {
  int a;
  int b[4];
  int c;
} ab = {4, {}, 5};

// CHECK{LITERAL}: var $ac <$_anon1> = [1= 2, 2= [1= 0, 2= [0, 0, 0, 0], 3= 0], 3= [0, 0, 0, 0], 4= 5]
struct {
  int a;
  struct AB b;
  int c[4];
  int d;
} ac = {2, {}, {}, 5};

// CHECK{LITERAL}: var $ad <$_anon2> = [1= 3]
struct {
  int a;
  int b[];
} ad = {3, {}};

struct {
  int a;
  struct AB b[3];
  int c[4];
  int d;
} ae;

// CHECK:  var $ap5 <* i32> = addrof ptr $ae 2 (68)
int *ap5 = &ae.b[2].c;

void foo(int a, int b, int c) {
  // CHECK: LOC 2 [[#SADEF: @LINE + 2 ]]{{$}}
  // CHECK-NEXT: var %sA <$A>
  struct A sA = {0, 1, 2};
  // CHECK: LOC 2 [[#SBDEF: @LINE + 2 ]]{{$}}
  // CHECK-NEXT: var %sB <$A>
  struct A sB = {a, b, c};
  // CHECK: LOC 2 [[#SCDEF: @LINE + 2 ]]{{$}}
  // CHECK-NEXT: var %sC <$A>
  struct A sC = {42};
  // CHECK: LOC 2 [[#SDDEF: @LINE + 2 ]]{{$}}
  // CHECK-NEXT: var %sD <$A>
  struct A sD = {b};
  // CHECK: LOC 2 [[#A1DEF: @LINE + 2 ]]{{$}}
  // CHECK-NEXT: var %a1 <[3] i32>
  int a1[3] = {9, 8, 7};
  // CHECK: LOC 2 [[#A2DEF: @LINE + 2 ]]{{$}}
  // CHECK-NEXT: var %a2 <[3] i32>
  int a2[3] = {a, b, c};
  // CHECK: LOC 2 [[#A3DEF: @LINE + 2 ]]{{$}}
  // CHECK-NEXT: var %a3 <[4] i16>
  short a3[4] = {5};
  // CHECK: LOC 2 [[#A4DEF: @LINE + 2 ]]{{$}}
  // CHECK-NEXT: var %a4 <[9] i32>
  int a4[9] = {7, b};
  // CHECK: LOC 2 [[#A5DEF: @LINE + 2 ]]{{$}}
  // CHECK-NEXT: var %a5 <[3][2] i32>
  int a5[3][2] = {{1, 2}, {3, 4}, {5, 6}};
  // CHECK: LOC 2 [[#A6DEF: @LINE + 2 ]]{{$}}
  // CHECK-NEXT: var %a6 <[3][2] i32>
  int a6[3][2] = {{1, 2}};
  // CHECK: LOC 2 [[#A7DEF: @LINE + 2 ]]{{$}}
  // CHECK-NEXT: var %a7 <[3][2] i32>
  int a7[3][2] = {{1}};
  // CHECK: LOC 2 [[#A8DEF: @LINE + 2 ]]{{$}}
  // CHECK-NEXT: var %a8 <[3][2] i32>
  int a8[3][2] = {1, 2};
  // CHECK: LOC 2 [[#A9DEF: @LINE + 2 ]]{{$}}
  // CHECK-NEXT: var %a9 <[3][2] i32>
  int a9[3][2] = {2};
  // CHECK: LOC 2 [[#A10DEF: @LINE + 2 ]]{{$}}
  // CHECK-NEXT: var %a10 <[3][2] i32>
  int a10[3][2] = {{a, b}, {b, c}, {c, a}};
  // CHECK: LOC 2 [[#A11DEF: @LINE + 2 ]]{{$}}
  // CHECK-NEXT: var %a11 <[3][2] i32>
  int a11[3][2] = {{a, b}};
  // CHECK: LOC 2 [[#A12DEF: @LINE + 2 ]]{{$}}
  // CHECK-NEXT: var %a12 <[3][2] i32>
  int a12[3][2] = {{a}};
  // CHECK: LOC 2 [[#A13DEF: @LINE + 2 ]]{{$}}
  // CHECK-NEXT: var %a13 <[3][2] i32>
  int a13[3][2] = {b, a};
  // CHECK: LOC 2 [[#A14DEF: @LINE + 2 ]]{{$}}
  // CHECK-NEXT: var %a14 <[3][2] i32>
  int a14[3][2] = {b};
  // CHECK: LOC 2 [[#STR1DEF: @LINE + 2 ]]{{$}}
  // CHECK-NEXT: var %str1 <[6] u8>
  char str1[] = "hello";
  // CHECK: LOC 2 [[#STR2DEF: @LINE + 2 ]]{{$}}
  // CHECK-NEXT: var %str2 <* u8>
  char *str2 = "world";
  // CHECK: LOC 2 [[#LD1DEF: @LINE + 2 ]]{{$}}
  // CHECK-NEXT: var %ld1 f64
  long double ld1 = 3.14L;

  // CHECK: LOC 2 [[#SADEF]]{{$}}
  // CHECK-NEXT: dassign %sA 1 (constval i32 0)
  // CHECK-NEXT: dassign %sA 2 (constval i32 1)
  // CHECK-NEXT: dassign %sA 3 (constval i32 2)
  
  // CHECK: LOC 2 [[#SBDEF]]{{$}}
  // CHECK-NEXT: dassign %sB 1 (dread i32 %a)
  // CHECK-NEXT: dassign %sB 2 (dread i32 %b)
  // CHECK-NEXT: dassign %sB 3 (dread i32 %c)

  // CHECK: LOC 2 [[#SCDEF]]{{$}}
  // CHECK-NEXT: dassign %sC 1 (constval i32 42)
  // CHECK-NEXT: dassign %sC 2 (constval i32 0)
  // CHECK-NEXT: dassign %sC 3 (constval i32 0)

  // CHECK: LOC 2 [[#SDDEF]]{{$}}
  // CHECK-NEXT: dassign %sD 1 (dread i32 %b)
  // CHECK-NEXT: dassign %sD 2 (constval i32 0)
  // CHECK-NEXT: dassign %sD 3 (constval i32 0)

  // CHECK: LOC 2 [[#A1DEF]]{{$}}
  // CHECK-NEXT:  iassign <* i32> 0 (
  // CHECK-NEXT:     array 0 a64 <* <[3] i32>> (addrof a64 %a1, constval u64 0),
  // CHECK-NEXT:    constval i32 9)
  // CHECK-NEXT:  iassign <* i32> 0 (
  // CHECK-NEXT:     array 0 a64 <* <[3] i32>> (addrof a64 %a1, constval u64 1),
  // CHECK-NEXT:    constval i32 8)
  // CHECK-NEXT:  iassign <* i32> 0 (
  // CHECK-NEXT:     array 0 a64 <* <[3] i32>> (addrof a64 %a1, constval u64 2),
  // CHECK-NEXT:    constval i32 7)

  // CHECK: LOC 2 [[#A2DEF]]{{$}}
  // CHECK-NEXT:  iassign <* i32> 0 (
  // CHECK-NEXT:     array 0 a64 <* <[3] i32>> (addrof a64 %a2, constval u64 0),
  // CHECK-NEXT:    dread i32 %a)
  // CHECK-NEXT:  iassign <* i32> 0 (
  // CHECK-NEXT:     array 0 a64 <* <[3] i32>> (addrof a64 %a2, constval u64 1),
  // CHECK-NEXT:    dread i32 %b)
  // CHECK-NEXT:  iassign <* i32> 0 (
  // CHECK-NEXT:     array 0 a64 <* <[3] i32>> (addrof a64 %a2, constval u64 2),
  // CHECK-NEXT:    dread i32 %c)

  // CHECK: LOC 2 [[#A3DEF]]{{$}}
  // CHECK-NEXT: iassign <* i16> 0 (
  // CHECK-NEXT:    array 0 a64 <* <[4] i16>> (addrof a64 %a3, constval u64 0),
  // CHECK-NEXT:   constval i32 5)
  // CHECK-NEXT: intrinsiccall C_memset (
  // CHECK-NEXT:   add u64 (addrof a64 %a3, constval a64 2),
  // CHECK-NEXT:   constval i32 0,
  // CHECK-NEXT:   constval u64 6)

  // CHECK: LOC 2 [[#A4DEF]]{{$}}
  // CHECK-NEXT: iassign <* i32> 0 (
  // CHECK-NEXT:    array 0 a64 <* <[9] i32>> (addrof a64 %a4, constval u64 0),
  // CHECK-NEXT:   constval i32 7)
  // CHECK-NEXT: iassign <* i32> 0 (
  // CHECK-NEXT:    array 0 a64 <* <[9] i32>> (addrof a64 %a4, constval u64 1),
  // CHECK-NEXT:   dread i32 %b)
  // CHECK-NEXT: intrinsiccall C_memset (
  // CHECK-NEXT:   add u64 (addrof a64 %a4, constval a64 8),
  // CHECK-NEXT:   constval i32 0,
  // CHECK-NEXT:   constval u64 28)

  // CHECK: LOC 2 [[#A5DEF]]{{$}}
  // CHECK-NEXT: iassign <* i32> 0 (
  // CHECK-NEXT:   array 0 a64 <* <[3][2] i32>> (addrof a64 %a5, constval u64 0, constval u64 0),
  // CHECK-NEXT:   constval i32 1)
  // CHECK-NEXT: iassign <* i32> 0 (
  // CHECK-NEXT:   array 0 a64 <* <[3][2] i32>> (addrof a64 %a5, constval u64 0, constval u64 1),
  // CHECK-NEXT:   constval i32 2)
  // CHECK-NEXT: iassign <* i32> 0 (
  // CHECK-NEXT:   array 0 a64 <* <[3][2] i32>> (addrof a64 %a5, constval u64 1, constval u64 0),
  // CHECK-NEXT:   constval i32 3)
  // CHECK-NEXT: iassign <* i32> 0 (
  // CHECK-NEXT:   array 0 a64 <* <[3][2] i32>> (addrof a64 %a5, constval u64 1, constval u64 1),
  // CHECK-NEXT:   constval i32 4)
  // CHECK-NEXT: iassign <* i32> 0 (
  // CHECK-NEXT:   array 0 a64 <* <[3][2] i32>> (addrof a64 %a5, constval u64 2, constval u64 0),
  // CHECK-NEXT:   constval i32 5)
  // CHECK-NEXT: iassign <* i32> 0 (
  // CHECK-NEXT:   array 0 a64 <* <[3][2] i32>> (addrof a64 %a5, constval u64 2, constval u64 1),
  // CHECK-NEXT:   constval i32 6)

  // CHECK: LOC 2 [[#A6DEF]]{{$}}
  // CHECK-NEXT: iassign <* i32> 0 (
  // CHECK-NEXT:   array 0 a64 <* <[3][2] i32>> (addrof a64 %a6, constval u64 0, constval u64 0),
  // CHECK-NEXT:   constval i32 1)
  // CHECK-NEXT: iassign <* i32> 0 (
  // CHECK-NEXT:   array 0 a64 <* <[3][2] i32>> (addrof a64 %a6, constval u64 0, constval u64 1),
  // CHECK-NEXT:   constval i32 2)
  // CHECK-NEXT: intrinsiccall C_memset (
  // CHECK-NEXT:   add u64 (addrof a64 %a6, constval a64 8),
  // CHECK-NEXT:   constval i32 0,
  // CHECK-NEXT:   constval u64 16)

  // CHECK: LOC 2 [[#A7DEF]]{{$}}
  // CHECK-NEXT: iassign <* i32> 0 (
  // CHECK-NEXT:   array 0 a64 <* <[3][2] i32>> (addrof a64 %a7, constval u64 0, constval u64 0),
  // CHECK-NEXT:   constval i32 1)
  // CHECK-NEXT: iassign <* i32> 0 (
  // CHECK-NEXT:   array 0 a64 <* <[3][2] i32>> (addrof a64 %a7, constval u64 0, constval u64 1),
  // CHECK-NEXT:    constval i32 0)
  // CHECK-NEXT: intrinsiccall C_memset (
  // CHECK-NEXT:   add u64 (addrof a64 %a7, constval a64 8),
  // CHECK-NEXT:   constval i32 0,
  // CHECK-NEXT:   constval u64 16)

  // CHECK: LOC 2 [[#A8DEF]]{{$}}
  // CHECK-NEXT: iassign <* i32> 0 (
  // CHECK-NEXT:   array 0 a64 <* <[3][2] i32>> (addrof a64 %a8, constval u64 0, constval u64 0),
  // CHECK-NEXT:   constval i32 1)
  // CHECK-NEXT: iassign <* i32> 0 (
  // CHECK-NEXT:   array 0 a64 <* <[3][2] i32>> (addrof a64 %a8, constval u64 0, constval u64 1),
  // CHECK-NEXT:   constval i32 2)
  // CHECK-NEXT: intrinsiccall C_memset (
  // CHECK-NEXT:   add u64 (addrof a64 %a8, constval a64 8),
  // CHECK-NEXT:   constval i32 0,
  // CHECK-NEXT:   constval u64 16)

  // CHECK: LOC 2 [[#A9DEF]]{{$}}
  // CHECK-NEXT: iassign <* i32> 0 (
  // CHECK-NEXT:   array 0 a64 <* <[3][2] i32>> (addrof a64 %a9, constval u64 0, constval u64 0),
  // CHECK-NEXT:   constval i32 2)
  // CHECK-NEXT: iassign <* i32> 0 (
  // CHECK-NEXT:    array 0 a64 <* <[3][2] i32>> (addrof a64 %a9, constval u64 0,  constval u64 1),
  // CHECK-NEXT:    constval i32 0)
  // CHECK-NEXT: intrinsiccall C_memset (
  // CHECK-NEXT:   add u64 (addrof a64 %a9, constval a64 8),
  // CHECK-NEXT:   constval i32 0,
  // CHECK-NEXT:   constval u64 16)

  // CHECK: LOC 2 [[#A10DEF]]{{$}}
  // CHECK-NEXT: iassign <* i32> 0 (
  // CHECK-NEXT:    array 0 a64 <* <[2] i32>> (
  // CHECK-NEXT:      array 0 a64 <* <[3][2] i32>> (addrof a64 %a10, constval u64 0),
  // CHECK-NEXT:     constval u64 0),
  // CHECK-NEXT:   dread i32 %a)
  // CHECK-NEXT: iassign <* i32> 0 (
  // CHECK-NEXT:    array 0 a64 <* <[2] i32>> (
  // CHECK-NEXT:      array 0 a64 <* <[3][2] i32>> (addrof a64 %a10, constval u64 0),
  // CHECK-NEXT:     constval u64 1),
  // CHECK-NEXT:   dread i32 %b)
  // CHECK-NEXT: iassign <* i32> 0 (
  // CHECK-NEXT:    array 0 a64 <* <[2] i32>> (
  // CHECK-NEXT:      array 0 a64 <* <[3][2] i32>> (addrof a64 %a10, constval u64 1),
  // CHECK-NEXT:     constval u64 0),
  // CHECK-NEXT:   dread i32 %b)
  // CHECK-NEXT: iassign <* i32> 0 (
  // CHECK-NEXT:    array 0 a64 <* <[2] i32>> (
  // CHECK-NEXT:      array 0 a64 <* <[3][2] i32>> (addrof a64 %a10, constval u64 1),
  // CHECK-NEXT:     constval u64 1),
  // CHECK-NEXT:   dread i32 %c)
  // CHECK-NEXT: iassign <* i32> 0 (
  // CHECK-NEXT:    array 0 a64 <* <[2] i32>> (
  // CHECK-NEXT:      array 0 a64 <* <[3][2] i32>> (addrof a64 %a10, constval u64 2),
  // CHECK-NEXT:     constval u64 0),
  // CHECK-NEXT:   dread i32 %c)
  // CHECK-NEXT: iassign <* i32> 0 (
  // CHECK-NEXT:    array 0 a64 <* <[2] i32>> (
  // CHECK-NEXT:      array 0 a64 <* <[3][2] i32>> (addrof a64 %a10, constval u64 2),
  // CHECK-NEXT:     constval u64 1),
  // CHECK-NEXT:   dread i32 %a)

  // CHECK: LOC 2 [[#A11DEF]]{{$}}
  // CHECK-NEXT: iassign <* i32> 0 (
  // CHECK-NEXT:    array 0 a64 <* <[2] i32>> (
  // CHECK-NEXT:      array 0 a64 <* <[3][2] i32>> (addrof a64 %a11, constval u64 0),
  // CHECK-NEXT:     constval u64 0),
  // CHECK-NEXT:   dread i32 %a)
  // CHECK-NEXT: iassign <* i32> 0 (
  // CHECK-NEXT:    array 0 a64 <* <[2] i32>> (
  // CHECK-NEXT:      array 0 a64 <* <[3][2] i32>> (addrof a64 %a11, constval u64 0),
  // CHECK-NEXT:     constval u64 1),
  // CHECK-NEXT:   dread i32 %b)
  // CHECK-NEXT: intrinsiccall C_memset (
  // CHECK-NEXT:   add u64 (addrof a64 %a11, constval a64 8),
  // CHECK-NEXT:   constval i32 0,
  // CHECK-NEXT:   constval u64 16)

  // CHECK: LOC 2 [[#A12DEF]]{{$}}
  // CHECK-NEXT: iassign <* i32> 0 (
  // CHECK-NEXT:    array 0 a64 <* <[2] i32>> (
  // CHECK-NEXT:      array 0 a64 <* <[3][2] i32>> (addrof a64 %a12, constval u64 0),
  // CHECK-NEXT:     constval u64 0),
  // CHECK-NEXT:   dread i32 %a)
  // CHECK-NEXT: intrinsiccall C_memset (
  // CHECK-NEXT:   add u64 (
  // CHECK-NEXT:      array 0 a64 <* <[3][2] i32>> (addrof a64 %a12, constval u64 0),
  // CHECK-NEXT:     constval a64 4),
  // CHECK-NEXT:   constval i32 0,
  // CHECK-NEXT:   constval u64 4)
  // CHECK-NEXT: intrinsiccall C_memset (
  // CHECK-NEXT:   add u64 (addrof a64 %a12, constval a64 8),
  // CHECK-NEXT:   constval i32 0,
  // CHECK-NEXT:   constval u64 16)

  // CHECK: LOC 2 [[#A13DEF]]{{$}}
  // CHECK-NEXT: iassign <* i32> 0 (
  // CHECK-NEXT:    array 0 a64 <* <[2] i32>> (
  // CHECK-NEXT:      array 0 a64 <* <[3][2] i32>> (addrof a64 %a13, constval u64 0),
  // CHECK-NEXT:     constval u64 0),
  // CHECK-NEXT:   dread i32 %b)
  // CHECK-NEXT: iassign <* i32> 0 (
  // CHECK-NEXT:    array 0 a64 <* <[2] i32>> (
  // CHECK-NEXT:      array 0 a64 <* <[3][2] i32>> (addrof a64 %a13, constval u64 0),
  // CHECK-NEXT:     constval u64 1),
  // CHECK-NEXT:   dread i32 %a)
  // CHECK-NEXT: intrinsiccall C_memset (
  // CHECK-NEXT:   add u64 (addrof a64 %a13, constval a64 8),
  // CHECK-NEXT:   constval i32 0,
  // CHECK-NEXT:   constval u64 16)

  // CHECK: LOC 2 [[#A14DEF]]{{$}}
  // CHECK-NEXT: iassign <* i32> 0 (
  // CHECK-NEXT:    array 0 a64 <* <[2] i32>> (
  // CHECK-NEXT:      array 0 a64 <* <[3][2] i32>> (addrof a64 %a14, constval u64 0),
  // CHECK-NEXT:     constval u64 0),
  // CHECK-NEXT:   dread i32 %b)
  // CHECK-NEXT: intrinsiccall C_memset (
  // CHECK-NEXT:   add u64 (
  // CHECK-NEXT:      array 0 a64 <* <[3][2] i32>> (addrof a64 %a14, constval u64 0),
  // CHECK-NEXT:     constval a64 4),
  // CHECK-NEXT:   constval i32 0,
  // CHECK-NEXT:   constval u64 4)
  // CHECK-NEXT: intrinsiccall C_memset (
  // CHECK-NEXT:   add u64 (addrof a64 %a14, constval a64 8),
  // CHECK-NEXT:   constval i32 0,
  // CHECK-NEXT:   constval u64 16)

  // CHECK: LOC 2 [[#STR1DEF]]{{$}}
  // CHECK-NEXT: intrinsiccall C_memcpy (addrof a64 %str1, conststr a64 "hello", constval i32 6)

  // CHECK: LOC 2 [[#STR2DEF]]{{$}}
  // CHECK-NEXT: dassign %str2 0 (conststr a64 "world")

  // CHECK: LOC 2 [[#LD1DEF]]{{$}}
  // CHECK-NEXT: dassign %ld1 0 (constval f64 3.1400000000000001)
}

void initEmbedded(int x, int y) {
  // CHECK: LOC 2 [[#E1DEF: @LINE + 2 ]]{{$}}
  // CHECK-NEXT: var %e1 <$E>
  struct E e1 = {1, {2, 3}, {4, 5}, 6};
  // CHECK: LOC 2 [[#E2DEF: @LINE + 2 ]]{{$}}
  // CHECK-NEXT: var %e2 <$E>
  struct E e2 = {x, {x, y}, {y, x}, y};
  // CHECK: LOC 2 [[#E3DEF: @LINE + 2 ]]{{$}}
  // CHECK-NEXT: var %e3 <$E>
  struct E e3 = {y, {1, 2}, {y, x}, x};

  // CHECK: LOC 2 [[#E1DEF]]{{$}}
  // CHECK-NEXT: dassign %e1 1 (constval i32 1)
  // CHECK-NEXT: dassign %e1 3 (constval i32 2)
  // CHECK-NEXT: dassign %e1 4 (constval i32 3)
  // CHECK-NEXT: dassign %e1 6 (constval i32 4)
  // CHECK-NEXT: dassign %e1 7 (constval i32 5)
  // CHECK-NEXT: dassign %e1 8 (constval i32 6)

  // CHECK: LOC 2 [[#E2DEF]]{{$}}
  // CHECK-NEXT: dassign %e2 1 (dread i32 %x)
  // CHECK-NEXT: dassign %e2 3 (dread i32 %x)
  // CHECK-NEXT: dassign %e2 4 (dread i32 %y)
  // CHECK-NEXT: dassign %e2 6 (dread i32 %y)
  // CHECK-NEXT: dassign %e2 7 (dread i32 %x)
  // CHECK-NEXT: dassign %e2 8 (dread i32 %y)

  // CHECK: LOC 2 [[#E3DEF]]{{$}}
  // CHECK-NEXT: dassign %e3 1 (dread i32 %y)
  // CHECK-NEXT: dassign %e3 3 (constval i32 1)
  // CHECK-NEXT: dassign %e3 4 (constval i32 2)
  // CHECK-NEXT: dassign %e3 6 (dread i32 %y)
  // CHECK-NEXT: dassign %e3 7 (dread i32 %x)
  // CHECK-NEXT: dassign %e3 8 (dread i32 %x)
}

void initStructArray(int x, int y) {
  // CHECK: LOC 2 [[#SF1DEF: @LINE + 2 ]]{{$}}
  // CHECK-NEXT: var %sF1 <$F>
  struct F sF1 = {42, {{9, 8}, {7, 6}}, 5};
  // CHECK: LOC 2 [[#SF2DEF: @LINE + 2 ]]{{$}}
  // CHECK-NEXT: var %sF2 <$F>
  struct F sF2 = {0};
  // CHECK: LOC 2 [[#SG1DEF: @LINE + 2 ]]{{$}}
  // CHECK-NEXT: var %sG1 <$G>
  struct G sG1 = {5, {42, {{9, 8}, {7, 6}}, 5}};
  // CHECK: LOC 2 [[#SG2DEF: @LINE + 2 ]]{{$}}
  // CHECK-NEXT: var %sG2 <$G>
  struct G sG2 = {0};
  // CHECK: LOC 2 [[#AF1DEF: @LINE + 2 ]]{{$}}
  // CHECK-NEXT: var %aF1 <[2] <$F>>
  struct F aF1[2] = {{42, {{9, 8}, {7, 6}}, 5}, {0}};
  // CHECK: LOC 2 [[#AF2DEF: @LINE + 2 ]]{{$}}
  // CHECK-NEXT: var %aF2 <[3] <$F>>
  struct F aF2[3] = {{1}};
  // CHECK: LOC 2 [[#XSF1DEF: @LINE + 2 ]]{{$}}
  // CHECK-NEXT: var %xsF1 <$F>
  struct F xsF1 = {x, {{y, 8}, {7, 6}}, x};
  // CHECK: LOC 2 [[#XSF2DEF: @LINE + 2 ]]{{$}}
  // CHECK-NEXT: var %xsF2 <$F>
  struct F xsF2 = {y};
  // CHECK: LOC 2 [[#XSG1DEF: @LINE + 2 ]]{{$}}
  // CHECK-NEXT: var %xsG1 <$G>
  struct G xsG1 = {5, {x, {{9, 8}, {x, y}}, 5}};
  // CHECK: LOC 2 [[#XSG2DEF: @LINE + 2 ]]{{$}}
  // CHECK-NEXT: var %xsG2 <$G>
  struct G xsG2 = {y};
  // CHECK: LOC 2 [[#XAF1DEF: @LINE + 2 ]]{{$}}
  // CHECK-NEXT: var %xaF1 <[2] <$F>>
  struct F xaF1[2] = {{42, {{9, 8}, {x, 6}}, 5}, {y}};
  // CHECK: LOC 2 [[#XAF2DEF: @LINE + 2 ]]{{$}}
  // CHECK-NEXT: var %xaF2 <[3] <$F>>
  struct F xaF2[3] = {{x}};

  // CHECK: LOC 2 [[#SF1DEF]]{{$}}
  // CHECK-NEXT: dassign %sF1 1 (constval i32 42)
  // CHECK-NEXT: iassign <* <$D>> 1 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (addrof a64 %sF1 2, constval u64 0)),
  // CHECK-NEXT:   constval i32 9)
  // CHECK-NEXT: iassign <* <$D>> 2 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (addrof a64 %sF1 2, constval u64 0)),
  // CHECK-NEXT:   constval i32 8)
  // CHECK-NEXT: iassign <* <$D>> 1 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (addrof a64 %sF1 2, constval u64 1)),
  // CHECK-NEXT:   constval i32 7)
  // CHECK-NEXT: iassign <* <$D>> 2 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (addrof a64 %sF1 2, constval u64 1)),
  // CHECK-NEXT:   constval i32 6)
  // CHECK-NEXT: dassign %sF1 5 (constval i32 5)

  // CHECK: LOC 2 [[#SF2DEF]]{{$}}
  // CHECK-NEXT: dassign %sF2 1 (constval i32 0)
  // CHECK-NEXT: iassign <* <$D>> 1 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (addrof a64 %sF2 2, constval u64 0)),
  // CHECK-NEXT:   constval i32 0)
  // CHECK-NEXT: iassign <* <$D>> 2 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (addrof a64 %sF2 2, constval u64 0)),
  // CHECK-NEXT:   constval i32 0)
  // CHECK-NEXT: iassign <* <$D>> 1 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (addrof a64 %sF2 2, constval u64 1)),
  // CHECK-NEXT:   constval i32 0)
  // CHECK-NEXT: iassign <* <$D>> 2 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (addrof a64 %sF2 2, constval u64 1)),
  // CHECK-NEXT:   constval i32 0)
  // CHECK-NEXT: dassign %sF2 5 (constval i32 0)

  // CHECK: LOC 2 [[#SG1DEF]]{{$}}
  // CHECK-NEXT: dassign %sG1 1 (constval i32 5)
  // CHECK-NEXT: dassign %sG1 3 (constval i32 42)
  // CHECK-NEXT: iassign <* <$D>> 1 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (addrof a64 %sG1 4, constval u64 0)),
  // CHECK-NEXT:   constval i32 9)
  // CHECK-NEXT: iassign <* <$D>> 2 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (addrof a64 %sG1 4, constval u64 0)),
  // CHECK-NEXT:   constval i32 8)
  // CHECK-NEXT: iassign <* <$D>> 1 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (addrof a64 %sG1 4, constval u64 1)),
  // CHECK-NEXT:   constval i32 7)
  // CHECK-NEXT: iassign <* <$D>> 2 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (addrof a64 %sG1 4, constval u64 1)),
  // CHECK-NEXT:   constval i32 6)
  // CHECK-NEXT: dassign %sG1 7 (constval i32 5)

  // CHECK: LOC 2 [[#SG2DEF]]{{$}}
  // CHECK-NEXT: dassign %sG2 1 (constval i32 0)
  // CHECK-NEXT: dassign %sG2 3 (constval i32 0)
  // CHECK-NEXT: iassign <* <$D>> 1 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (addrof a64 %sG2 4, constval u64 0)),
  // CHECK-NEXT:   constval i32 0)
  // CHECK-NEXT: iassign <* <$D>> 2 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (addrof a64 %sG2 4, constval u64 0)),
  // CHECK-NEXT:   constval i32 0)
  // CHECK-NEXT: iassign <* <$D>> 1 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (addrof a64 %sG2 4, constval u64 1)),
  // CHECK-NEXT:   constval i32 0)
  // CHECK-NEXT: iassign <* <$D>> 2 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (addrof a64 %sG2 4, constval u64 1)),
  // CHECK-NEXT:   constval i32 0)
  // CHECK-NEXT: dassign %sG2 5 (constval i32 0)

  // CHECK: LOC 2 [[#AF1DEF]]{{$}}
  // CHECK-NEXT: iassign <* <$F>> 1 (
  // CHECK-NEXT:   iaddrof a64 <* <$F>> 0 (array 0 a64 <* <[2] <$F>>> (addrof a64 %aF1, constval u64 0)),
  // CHECK-NEXT:   constval i32 42)
  // CHECK-NEXT: iassign <* <$D>> 1 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (
  // CHECK-NEXT:     iaddrof a64 <* <$F>> 2 (array 0 a64 <* <[2] <$F>>> (addrof a64 %aF1, constval u64 0)),
  // CHECK-NEXT:     constval u64 0)),
  // CHECK-NEXT:   constval i32 9)
  // CHECK-NEXT: iassign <* <$D>> 2 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (
  // CHECK-NEXT:     iaddrof a64 <* <$F>> 2 (array 0 a64 <* <[2] <$F>>> (addrof a64 %aF1, constval u64 0)),
  // CHECK-NEXT:     constval u64 0)),
  // CHECK-NEXT:   constval i32 8)
  // CHECK-NEXT: iassign <* <$D>> 1 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (
  // CHECK-NEXT:     iaddrof a64 <* <$F>> 2 (array 0 a64 <* <[2] <$F>>> (addrof a64 %aF1, constval u64 0)),
  // CHECK-NEXT:     constval u64 1)),
  // CHECK-NEXT:   constval i32 7)
  // CHECK-NEXT: iassign <* <$D>> 2 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (
  // CHECK-NEXT:     iaddrof a64 <* <$F>> 2 (array 0 a64 <* <[2] <$F>>> (addrof a64 %aF1, constval u64 0)),
  // CHECK-NEXT:     constval u64 1)),
  // CHECK-NEXT:   constval i32 6)
  // CHECK-NEXT: iassign <* <$F>> 5 (
  // CHECK-NEXT:   iaddrof a64 <* <$F>> 0 (array 0 a64 <* <[2] <$F>>> (addrof a64 %aF1, constval u64 0)),
  // CHECK-NEXT:   constval i32 5)
  // CHECK-NEXT: iassign <* <$F>> 1 (
  // CHECK-NEXT:   iaddrof a64 <* <$F>> 0 (array 0 a64 <* <[2] <$F>>> (addrof a64 %aF1, constval u64 1)),
  // CHECK-NEXT:   constval i32 0)
  // CHECK-NEXT: iassign <* <$D>> 1 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (
  // CHECK-NEXT:     iaddrof a64 <* <$F>> 2 (array 0 a64 <* <[2] <$F>>> (addrof a64 %aF1, constval u64 1)),
  // CHECK-NEXT:     constval u64 0)),
  // CHECK-NEXT:   constval i32 0)
  // CHECK-NEXT: iassign <* <$D>> 2 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (
  // CHECK-NEXT:     iaddrof a64 <* <$F>> 2 (array 0 a64 <* <[2] <$F>>> (addrof a64 %aF1, constval u64 1)),
  // CHECK-NEXT:     constval u64 0)),
  // CHECK-NEXT:   constval i32 0)
  // CHECK-NEXT: iassign <* <$D>> 1 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (
  // CHECK-NEXT:     iaddrof a64 <* <$F>> 2 (array 0 a64 <* <[2] <$F>>> (addrof a64 %aF1, constval u64 1)),
  // CHECK-NEXT:     constval u64 1)),
  // CHECK-NEXT:   constval i32 0)
  // CHECK-NEXT: iassign <* <$D>> 2 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (
  // CHECK-NEXT:     iaddrof a64 <* <$F>> 2 (array 0 a64 <* <[2] <$F>>> (addrof a64 %aF1, constval u64 1)),
  // CHECK-NEXT:     constval u64 1)),
  // CHECK-NEXT:   constval i32 0)
  // CHECK-NEXT: iassign <* <$F>> 5 (
  // CHECK-NEXT:   iaddrof a64 <* <$F>> 0 (array 0 a64 <* <[2] <$F>>> (addrof a64 %aF1, constval u64 1)),
  // CHECK-NEXT:   constval i32 0)

  // CHECK: LOC 2 [[#AF2DEF]]{{$}}
  // CHECK-NEXT: iassign <* <$F>> 1 (
  // CHECK-NEXT:   iaddrof a64 <* <$F>> 0 (array 0 a64 <* <[3] <$F>>> (addrof a64 %aF2, constval u64 0)),
  // CHECK-NEXT:   constval i32 1)
  // CHECK-NEXT: iassign <* <$D>> 1 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (
  // CHECK-NEXT:     iaddrof a64 <* <$F>> 2 (array 0 a64 <* <[3] <$F>>> (addrof a64 %aF2, constval u64 0)),
  // CHECK-NEXT:     constval u64 0)),
  // CHECK-NEXT:   constval i32 0)
  // CHECK-NEXT: iassign <* <$D>> 2 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (
  // CHECK-NEXT:     iaddrof a64 <* <$F>> 2 (array 0 a64 <* <[3] <$F>>> (addrof a64 %aF2, constval u64 0)),
  // CHECK-NEXT:     constval u64 0)),
  // CHECK-NEXT:   constval i32 0)
  // CHECK-NEXT: iassign <* <$D>> 1 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (
  // CHECK-NEXT:     iaddrof a64 <* <$F>> 2 (array 0 a64 <* <[3] <$F>>> (addrof a64 %aF2, constval u64 0)),
  // CHECK-NEXT:     constval u64 1)),
  // CHECK-NEXT:   constval i32 0)
  // CHECK-NEXT: iassign <* <$D>> 2 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (
  // CHECK-NEXT:     iaddrof a64 <* <$F>> 2 (array 0 a64 <* <[3] <$F>>> (addrof a64 %aF2, constval u64 0)),
  // CHECK-NEXT:     constval u64 1)),
  // CHECK-NEXT:   constval i32 0)
  // CHECK-NEXT: iassign <* <$F>> 5 (
  // CHECK-NEXT:   iaddrof a64 <* <$F>> 0 (array 0 a64 <* <[3] <$F>>> (addrof a64 %aF2, constval u64 0)),
  // CHECK-NEXT:   constval i32 0)
  // CHECK-NEXT: intrinsiccall C_memset (
  // CHECK-NEXT:   add u64 (addrof a64 %aF2, constval a64 24),
  // CHECK-NEXT:   constval i32 0,
  // CHECK-NEXT:   constval u64 48)

  // CHECK: LOC 2 [[#XSF1DEF]]{{$}}
  // CHECK-NEXT: dassign %xsF1 1 (dread i32 %x)
  // CHECK-NEXT: iassign <* <$D>> 1 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (addrof a64 %xsF1 2, constval u64 0)),
  // CHECK-NEXT:   dread i32 %y)
  // CHECK-NEXT: iassign <* <$D>> 2 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (addrof a64 %xsF1 2, constval u64 0)),
  // CHECK-NEXT:   constval i32 8)
  // CHECK-NEXT: iassign <* <$D>> 1 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (addrof a64 %xsF1 2, constval u64 1)),
  // CHECK-NEXT:   constval i32 7)
  // CHECK-NEXT: iassign <* <$D>> 2 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (addrof a64 %xsF1 2, constval u64 1)),
  // CHECK-NEXT:   constval i32 6)
  // CHECK-NEXT: dassign %xsF1 5 (dread i32 %x)

  // CHECK: LOC 2 [[#XSF2DEF]]{{$}}
  // CHECK-NEXT: dassign %xsF2 1 (dread i32 %y)
  // CHECK-NEXT: iassign <* <$D>> 1 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (addrof a64 %xsF2 2, constval u64 0)),
  // CHECK-NEXT:   constval i32 0)
  // CHECK-NEXT: iassign <* <$D>> 2 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (addrof a64 %xsF2 2, constval u64 0)),
  // CHECK-NEXT:   constval i32 0)
  // CHECK-NEXT: iassign <* <$D>> 1 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (addrof a64 %xsF2 2, constval u64 1)),
  // CHECK-NEXT:   constval i32 0)
  // CHECK-NEXT: iassign <* <$D>> 2 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (addrof a64 %xsF2 2, constval u64 1)),
  // CHECK-NEXT:   constval i32 0)
  // CHECK-NEXT: dassign %xsF2 5 (constval i32 0)

  // CHECK: LOC 2 [[#XSG1DEF]]{{$}}
  // CHECK-NEXT: dassign %xsG1 1 (constval i32 5)
  // CHECK-NEXT: dassign %xsG1 3 (dread i32 %x)
  // CHECK-NEXT: iassign <* <$D>> 1 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (addrof a64 %xsG1 4, constval u64 0)),
  // CHECK-NEXT:   constval i32 9)
  // CHECK-NEXT: iassign <* <$D>> 2 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (addrof a64 %xsG1 4, constval u64 0)),
  // CHECK-NEXT:   constval i32 8)
  // CHECK-NEXT: iassign <* <$D>> 1 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (addrof a64 %xsG1 4, constval u64 1)),
  // CHECK-NEXT:   dread i32 %x)
  // CHECK-NEXT: iassign <* <$D>> 2 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (addrof a64 %xsG1 4, constval u64 1)),
  // CHECK-NEXT:   dread i32 %y)
  // CHECK-NEXT: dassign %xsG1 7 (constval i32 5)

  // CHECK: LOC 2 [[#XSG2DEF]]{{$}}
  // CHECK-NEXT: dassign %xsG2 1 (dread i32 %y)
  // CHECK-NEXT: dassign %xsG2 3 (constval i32 0)
  // CHECK-NEXT: iassign <* <$D>> 1 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (addrof a64 %xsG2 4, constval u64 0)),
  // CHECK-NEXT:   constval i32 0)
  // CHECK-NEXT: iassign <* <$D>> 2 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (addrof a64 %xsG2 4, constval u64 0)),
  // CHECK-NEXT:   constval i32 0)
  // CHECK-NEXT: iassign <* <$D>> 1 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (addrof a64 %xsG2 4, constval u64 1)),
  // CHECK-NEXT:   constval i32 0)
  // CHECK-NEXT: iassign <* <$D>> 2 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (addrof a64 %xsG2 4, constval u64 1)),
  // CHECK-NEXT:   constval i32 0)
  // CHECK-NEXT: dassign %xsG2 5 (constval i32 0)

  // CHECK: LOC 2 [[#XAF1DEF]]{{$}}
  // CHECK-NEXT: iassign <* <$F>> 1 (
  // CHECK-NEXT:   iaddrof a64 <* <$F>> 0 (array 0 a64 <* <[2] <$F>>> (addrof a64 %xaF1, constval u64 0)),
  // CHECK-NEXT:   constval i32 42)
  // CHECK-NEXT: iassign <* <$D>> 1 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (
  // CHECK-NEXT:     iaddrof a64 <* <$F>> 2 (array 0 a64 <* <[2] <$F>>> (addrof a64 %xaF1, constval u64 0)),
  // CHECK-NEXT:     constval u64 0)),
  // CHECK-NEXT:   constval i32 9)
  // CHECK-NEXT: iassign <* <$D>> 2 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (
  // CHECK-NEXT:     iaddrof a64 <* <$F>> 2 (array 0 a64 <* <[2] <$F>>> (addrof a64 %xaF1, constval u64 0)),
  // CHECK-NEXT:     constval u64 0)),
  // CHECK-NEXT:   constval i32 8)
  // CHECK-NEXT: iassign <* <$D>> 1 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (
  // CHECK-NEXT:     iaddrof a64 <* <$F>> 2 (array 0 a64 <* <[2] <$F>>> (addrof a64 %xaF1, constval u64 0)),
  // CHECK-NEXT:     constval u64 1)),
  // CHECK-NEXT:   dread i32 %x)
  // CHECK-NEXT: iassign <* <$D>> 2 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (
  // CHECK-NEXT:     iaddrof a64 <* <$F>> 2 (array 0 a64 <* <[2] <$F>>> (addrof a64 %xaF1, constval u64 0)),
  // CHECK-NEXT:     constval u64 1)),
  // CHECK-NEXT:   constval i32 6)
  // CHECK-NEXT: iassign <* <$F>> 5 (
  // CHECK-NEXT:   iaddrof a64 <* <$F>> 0 (array 0 a64 <* <[2] <$F>>> (addrof a64 %xaF1, constval u64 0)),
  // CHECK-NEXT:   constval i32 5)
  // CHECK-NEXT: iassign <* <$F>> 1 (
  // CHECK-NEXT:   iaddrof a64 <* <$F>> 0 (array 0 a64 <* <[2] <$F>>> (addrof a64 %xaF1, constval u64 1)),
  // CHECK-NEXT:   dread i32 %y)
  // CHECK-NEXT: iassign <* <$D>> 1 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (
  // CHECK-NEXT:     iaddrof a64 <* <$F>> 2 (array 0 a64 <* <[2] <$F>>> (addrof a64 %xaF1, constval u64 1)),
  // CHECK-NEXT:     constval u64 0)),
  // CHECK-NEXT:   constval i32 0)
  // CHECK-NEXT: iassign <* <$D>> 2 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (
  // CHECK-NEXT:     iaddrof a64 <* <$F>> 2 (array 0 a64 <* <[2] <$F>>> (addrof a64 %xaF1, constval u64 1)),
  // CHECK-NEXT:     constval u64 0)),
  // CHECK-NEXT:   constval i32 0)
  // CHECK-NEXT: iassign <* <$D>> 1 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (
  // CHECK-NEXT:     iaddrof a64 <* <$F>> 2 (array 0 a64 <* <[2] <$F>>> (addrof a64 %xaF1, constval u64 1)),
  // CHECK-NEXT:     constval u64 1)),
  // CHECK-NEXT:   constval i32 0)
  // CHECK-NEXT: iassign <* <$D>> 2 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (
  // CHECK-NEXT:     iaddrof a64 <* <$F>> 2 (array 0 a64 <* <[2] <$F>>> (addrof a64 %xaF1, constval u64 1)),
  // CHECK-NEXT:     constval u64 1)),
  // CHECK-NEXT:   constval i32 0)
  // CHECK-NEXT: iassign <* <$F>> 5 (
  // CHECK-NEXT:   iaddrof a64 <* <$F>> 0 (array 0 a64 <* <[2] <$F>>> (addrof a64 %xaF1, constval u64 1)),
  // CHECK-NEXT:   constval i32 0)

  // CHECK: LOC 2 [[#XAF2DEF]]{{$}}
  // CHECK-NEXT: iassign <* <$F>> 1 (
  // CHECK-NEXT:   iaddrof a64 <* <$F>> 0 (array 0 a64 <* <[3] <$F>>> (addrof a64 %xaF2, constval u64 0)),
  // CHECK-NEXT:   dread i32 %x)
  // CHECK-NEXT: iassign <* <$D>> 1 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (
  // CHECK-NEXT:     iaddrof a64 <* <$F>> 2 (array 0 a64 <* <[3] <$F>>> (addrof a64 %xaF2, constval u64 0)),
  // CHECK-NEXT:     constval u64 0)),
  // CHECK-NEXT:   constval i32 0)
  // CHECK-NEXT: iassign <* <$D>> 2 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (
  // CHECK-NEXT:     iaddrof a64 <* <$F>> 2 (array 0 a64 <* <[3] <$F>>> (addrof a64 %xaF2, constval u64 0)),
  // CHECK-NEXT:     constval u64 0)),
  // CHECK-NEXT:   constval i32 0)
  // CHECK-NEXT: iassign <* <$D>> 1 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (
  // CHECK-NEXT:     iaddrof a64 <* <$F>> 2 (array 0 a64 <* <[3] <$F>>> (addrof a64 %xaF2, constval u64 0)),
  // CHECK-NEXT:     constval u64 1)),
  // CHECK-NEXT:   constval i32 0)
  // CHECK-NEXT: iassign <* <$D>> 2 (
  // CHECK-NEXT:   iaddrof a64 <* <$D>> 0 (array 0 a64 <* <[2] <$D>>> (
  // CHECK-NEXT:     iaddrof a64 <* <$F>> 2 (array 0 a64 <* <[3] <$F>>> (addrof a64 %xaF2, constval u64 0)),
  // CHECK-NEXT:     constval u64 1)),
  // CHECK-NEXT:   constval i32 0)
  // CHECK-NEXT: iassign <* <$F>> 5 (
  // CHECK-NEXT:   iaddrof a64 <* <$F>> 0 (array 0 a64 <* <[3] <$F>>> (addrof a64 %xaF2, constval u64 0)),
  // CHECK-NEXT:   constval i32 0)
  // CHECK-NEXT: intrinsiccall C_memset (
  // CHECK-NEXT:   add u64 (addrof a64 %xaF2, constval a64 24),
  // CHECK-NEXT:   constval i32 0,
  // CHECK-NEXT:   constval u64 48)
}
